package com.corechina.apex_osswords.domain.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.corechina.apex_osswords.domain.entity.CorePlace;
import com.corechina.apex_osswords.domain.vo.CorePlaceVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

/**
 * <p>
 * 地点管理 Mapper 接口
 * </p>
 *
 * @author cc
 * @since 2022-05-30
 */
@Component
public interface CorePlaceMapper extends BaseMapper<CorePlace> {

    @Update("update core_place set is_del = #{isDel} where id = #{id}")
    int updateIsDel(@Param("isDel") Integer isDel, @Param("id") Integer id);

    IPage<CorePlaceVo> getList(Page page, @Param("name") String name, @Param("serviceId") Integer serviceId, @Param("enterpriseId") Integer enterpriseId);

    IPage<CorePlaceVo> getPlaceList(Page page, @Param("isDel") Integer isDel, @Param("projectId") Integer projectType);

    @Update("update core_place set is_del = #{isDel} where service_id = #{serviceId}")
    int updateIsDelByServiceId(@Param("isDel") Integer isDel, @Param("serviceId") Integer serviceId);
}
